/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -29
 * Time: 23:04
 */
public abstract class GeoGraph implements Comparable<GeoGraph>,Colorable {
    private int color;
    private boolean filled;

    public abstract double getArea();
    public abstract double getPerimeter();

    @Override
    public int compareTo(GeoGraph o) {
        return (int)(getArea() - o.getArea());
    };
    @Override
    public void procColor(GeoGraph o) {
        int color = (int)getArea();
        while(color >= 100) {
            color /= 10;
        }
        setColor(color);
    };

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public boolean isFilled() {
        return filled;
    }

    public void setFilled(boolean filled) {
        this.filled = filled;
    }
}